Open
Conversation
README.md 파일을 수정했습니다. 다음의 항목이 추가되었습니다. - 개요 - 기술 스택 - 기능 목록 - 개발 규칙 및 스타일 가이드
1부터 9까지의 숫자 중에서 서로 다른 3개의 숫자를 무작위로 생성합니다. 구현 접근: - java.util.Random을 사용하여 1부터 9까지의 숫자를 랜덤으로 생성 - HashSet을 이용하여 중복을 피하면서 숫자를 저장 - 세 개의 숫자가 저장될 때까지 숫자를 생성하고 저장
사용자에게 3자리 숫자를 입력받습니다. 구현 접근: - BufferedReader를 사용하여 사용자로부터 입력을 받습니다. - 입력받은 값을 문자열로 저장하여 처리합니다.
입력받은 숫자가 3자리이며, 각 숫자가 1부터 9까지이고, 중복되지 않는지 확인합니다. 구현 접근: - 입력 문자열의 길이가 3인지 확인 - 문자열의 각 문자를 숫자로 변환하고, 1부터 9 사이의 값인지 확인 - HashSet을 사용하여 숫자의 중복을 검사
사용자의 입력과 컴퓨터가 생성한 숫자를 비교하여 스트라이크와 볼의 결과를 계산하고 반환합니다. 구현 접근: - 입력된 숫자와 생성된 숫자를 비교하여 위치와 값이 동일한 경우 스트라이크를 증가 - 위치는 다르지만 값이 존재하는 경우 볼을 증가 - 결과를 반환
컴퓨터가 생성한 숫자를 관리할 때 HashSet이 아닌 LinkedHashSet을 사용하도록 변경합니다. HashSet은 순서가 보장되지 않기에 라운드가 진행될 때마다 숫자가 바뀔 수 있습니다. 따라서 Set의 기능을 그대로 사용할 수 있지만 순서가 유지되는 LinkedHashSet로 변경합니다.
…or exit 라운드 결과를 표시하며, 사용자가 게임을 새로 시작할지 또는 종료할지 선택할 수 있게 합니다. 구현 접근: - 라운드의 결과(정답 여부, 오류 처리 등)를 표시 - 게임의 결과가 나오면 사용자에게 새 게임 시작 여부를 확인 - 입력에 따라 게임을 재시작하거나 종료
다양한 Unit Test를 세 가지 테스트 클래스에 추가하여 게임 로직을 테스트합니다. 추가된 테스트는 다음과 같습니다: 1. NumberGeneratorTest - 생성된 숫자가 고유하며 정해진 범위 내에 있는지 검토 2. InputValidatorTest - 사용자 입력이 올바른 형식을 따르고 중복되지 않는지 검증 3. ResultCalculatorTest - 다양한 게임 시나리오에서 점수 계산의 정확성을 검토
프로그래밍 요구사항 - 1의 2번 조건을 충족시키기 위해 파일명을 수정하였습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.